home *** CD-ROM | disk | FTP | other *** search
- Path: nntp0.brunel.ac.uk!usenet
- From: Francesco Fantauzzi <mapgfgf@brunel.ac.uk>
- Newsgroups: comp.lang.c++
- Subject: Re: Getting time and date?
- Date: 12 Jan 1996 11:46:53 GMT
- Organization: Brunel University
- Message-ID: <4d5hnd$8n6@izar.brunel.ac.uk>
- References: <4d4bcb$3ti@hermes.louisville.edu>
- NNTP-Posting-Host: maths-pc-125.brunel.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
-
- bbboon01@homer.louisville.edu (Billy Boone) wrote:
- >I was wondering if there were any functions for getting the current time >and date. I'm using Visual C++ 1.5.
-
- You can use time() and ctime(). The following example is cut & pasted
- from Borland C++ help:
-
-
- #include <stdio.h>
- #include <time.h>
-
- int main(void)
- {
- time_t t;
-
- time(&t);
- printf("Today's date and time: %s\n", ctime(&t));
- return 0;
- }
-
-
- Francesco G. Fantauzzi
-
-
-